<?php

  session_start();
  include "config.php";
  include "ALorder.php";

  if(isset($_SESSION["user"]))
  {
    include "$header";
    include "$body";
?>

<div style="position:absolute; top:0px; left:1px; border:0;">
  <span class="prevPage">Cancel Order:Search > </span>
  <span class="prevPage">Search Results > </span>
  <span class="page">Confirm Cancellation</span>
</div>
  
<?php

  include "$H_co";
  
  echo "Customer No. <b>".$_SESSION["customerID"]."</b><p>";

  if(isset($_POST["yes"]))
  {
    if(cancelOrder($_SESSION[order_no], $_SESSION["customerID"]) == false)
    {
      echo "<SCRIPT language='Javascript'>";
      echo "  alert('The order could not be cancelled.  Please try again.');";
      echo "</SCRIPT>";
    }
    else
    {
      echo "<SCRIPT language='Javascript'>";
      echo "  window.location.href = 'cancelOrder_3success.php';";
      echo "</SCRIPT>";
    }
  }
  else if(isset($_POST["no"]))
  {
    echo "<SCRIPT language='Javascript'>";
    echo "  window.location.href = 'cancelOrder_1searchResults.php';";
    echo "</SCRIPT>";
  }

?>

<p>
<b>CONFIRMATION: ARE THESE DETAILS ACCURATE?</b>
<p>
Order to cancel:
<p>
<table width="99%" style="border:1px solid #000000">
  <tr>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Order No.</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Date Ordered</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Order<br>Status</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Product No.</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Item No.</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Product Type</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Colour</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Size</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Description</b></font>
    </td>
    <td style="border:1px solid #000000; background-color:#666666;">
      <font color="#FFFFFF"><b>Price</b></font>
    </td>
  </tr>
  
<?php

getOneOrderDetails($_SESSION["customerID"], $_SESSION["order_no"]);

?>

</table>
<form name="orderCancel" action="" method="post">
  <input name="no" type=submit style="font-family:'Century Gothic'; font-size:12px; color:#000000; border:1px solid #000000; width:70px; background-color:#FFFFFF" value="No"/>&nbsp;&nbsp;
  <input name="yes" type=submit style="font-family:'Century Gothic'; font-size:12px; color:#000000; border:1px solid #000000; width:70px; background-color:#FFFFFF" value="Yes"/>
</form>
</BODY>

<?php

  include "$footer";

  }

?>